package com.zhisheng.core.security.action;

import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.zhisheng.core.security.entity.User;
import com.zhisheng.core.security.support.SecurityUserHolder;


public class SerurityBaseAction extends ActionSupport implements RequestAware,SessionAware {

	/**	 */
	private static final long serialVersionUID = -721128194016873459L;
	
	protected Map request;
	
	protected Map session;
	
	/**
	 * @param menu the menu to set
	 */
	public void setMenu(String menu) {
		session.put("menu", menu);
	}

	@Override
	public void setRequest(Map request) {
		this.request = request;
	}

	@Override
	public void setSession(Map session) {
		this.session = session;
	}

	/**
	 * @return the request
	 */
	public Map getRequest() {
		return request;
	}

	/**
	 * @return the session
	 */
	public Map getSession() {
		return session;
	}

    /**
     * Get current user
     * 
     * @return
     */
    public User getCurrentUser() {
    	return SecurityUserHolder.getCurrentUser();
    }

}

